#ifndef THREAD_H
#define THREAD_H
#include "MkTypes.h"

typedef void ThreadFun(void* lParam);

class CMkThread
{
public:
	CMkThread();
	virtual ~CMkThread();
public:
	Uint32 Start(ThreadFun Func, void* lParam);
	void Stop();


	static void ThreadSleep(Uint32 dwMilliseconds);
protected:
#ifdef _WIN32
	static unsigned int __stdcall Thread(void *lParam);
#else
	static void *threadrun(void *lParam);
#endif
private:
#ifdef _WIN32
	HANDLE	m_ThreadHandle;
#else
	pthread_t m_ThreadHandle;
#endif
	ThreadFun*	m_Fun;
	void*		m_lParam;
};








#endif